{
  "nbformat": 4,
  "nbformat_minor": 0,
  "metadata": {
    "colab": {
      "name": "Google_Drive_Online_Decompression.ipynb",
      "provenance": [],
      "collapsed_sections": []
    },
    "kernelspec": {
      "name": "python3",
      "display_name": "Python 3"
    }
  },
  "cells": [
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "KTxQcgrJ4Ps1",
        "colab_type": "text"
      },
      "source": [
        "# **第一步 绑定GoogleDrive**\n"
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "dNNdazup4OtO",
        "colab_type": "code",
        "cellView": "form",
        "colab": {}
      },
      "source": [
        "#@markdown  点击左侧按钮，授权绑定GoogleDrive\n",
        "from google.colab import drive\n",
        "drive.mount('/content/drive')"
      ],
      "execution_count": null,
      "outputs": []
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "V9HIk6h6Nj8E",
        "colab_type": "text"
      },
      "source": [
        "# **RAR**"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "K-CsXWjq0sHF",
        "colab_type": "text"
      },
      "source": [
        "# 查看单个RAR压缩文件的目录树"
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "7lO2P4Vk0_Yo",
        "colab_type": "code",
        "cellView": "form",
        "colab": {}
      },
      "source": [
        "#@markdown 点击左侧按钮，查看单个RAR压缩包里面的目录结构\n",
        "\n",
        "#@markdown <font size=\"4\" color=red><b>destination</b></font>  查看的RAR压缩包的路径（带.rar后缀）\n",
        "\n",
        "destination =  \"\" #@param {type:\"string\"}\n",
        "!unrar v \"$destination\""
      ],
      "execution_count": null,
      "outputs": []
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "JCAU3eTK4l7V",
        "colab_type": "text"
      },
      "source": [
        "# 查看目录下所有RAR压缩文件的目录树"
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "LPhgWJhT4qL0",
        "colab_type": "code",
        "cellView": "form",
        "colab": {}
      },
      "source": [
        "#@markdown 点击左侧按钮，查看目录下所有RAR压缩包的目录结构\n",
        "\n",
        "#@markdown <font size=\"4\" color=red><b>destination</b></font>  要查看的目录的路径（不带.rar后缀）\n",
        "\n",
        "destination =  \"\" #@param {type:\"string\"}\n",
        "!unrar v \"$destination/*.rar\""
      ],
      "execution_count": null,
      "outputs": []
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "b9dBiBONgb7-",
        "colab_type": "text"
      },
      "source": [
        "## 解压单个RAR压缩包 ****支持分压卷****"
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "OX6_9OC24jBB",
        "colab_type": "code",
        "cellView": "form",
        "colab": {}
      },
      "source": [
        "#@markdown 点击左侧按钮，解压单个RAR压缩包\n",
        "\n",
        "#@markdown <font size=\"4\" color=red><b>destination</b></font>  解压的文件的路径（带.rar后缀）\n",
        "\n",
        "destination =  \"\" #@param {type:\"string\"}\n",
        "\n",
        "#@markdown <font size=\"4\" color=red><b>files</b></font>  解压文件的目的地(目录)\n",
        "\n",
        "files = \"\" #@param {type:\"string\"}\n",
        "\n",
        "#@markdown <font size=\"4\" color=red><b>password</b></font>  解压密码（有就填写没有就不填）\n",
        "\n",
        "password = \"\" #@param {type:\"string\"}\n",
        "\n",
        "print(\"若没有设置密码则直接回车即可\")\n",
        "\n",
        "!unrar x -p\"$password\" -o+ \"$destination\" \"$files\""
      ],
      "execution_count": null,
      "outputs": []
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "GpmveD-q1csM",
        "colab_type": "text"
      },
      "source": [
        "## 批量解压RAR"
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "0V3bePvK1jdi",
        "colab_type": "code",
        "cellView": "form",
        "colab": {}
      },
      "source": [
        "#@markdown 点击左侧按钮，解压整个目录下多个RAR压缩包\n",
        "\n",
        "#@markdown <font size=\"4\" color=red><b>destination</b></font>  解压的文件的路径（不带.rar后缀）\n",
        "\n",
        "destination =  \"\"  #@param {type:\"string\"}\n",
        "\n",
        "#@markdown <font size=\"4\" color=red><b>files</b></font>  解压文件的目的地(目录)\n",
        "\n",
        "files = \"\" #@param {type:\"string\"}\n",
        "\n",
        "#@markdown <font size=\"4\" color=red><b>password</b></font>  解压密码（有就填写没有就不填，因为是批量！所以必须密码是统一的，否则必定报错！！！）\n",
        "\n",
        "password = \"\" #@param {type:\"string\"}\n",
        "\n",
        "print(\"若没有设置密码则直接回车即可\")\n",
        "\n",
        "!unrar x -p\"$password\" -o+ \"$destination/*.rar\" \"$files\" "
      ],
      "execution_count": null,
      "outputs": []
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "BoYpEFE-olJ6",
        "colab_type": "text"
      },
      "source": [
        "# **ZIP**"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "99A7HlNIOJcD",
        "colab_type": "text"
      },
      "source": [
        "# 查看单个ZIP压缩文件的目录树"
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "US8HfBTxOKom",
        "colab_type": "code",
        "cellView": "form",
        "colab": {}
      },
      "source": [
        "#@markdown 点击左侧按钮，查看单个ZIP压缩包的目录结构\n",
        "\n",
        "#@markdown <font size=\"4\" color=red><b>destination</b></font>  查看的文件的路径（带.zip后缀）\n",
        "\n",
        "destination =  \"\" #@param {type:\"string\"}\n",
        "\n",
        "!unzip -l \"$destination\""
      ],
      "execution_count": null,
      "outputs": []
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "sYD6YExfj4E7",
        "colab_type": "text"
      },
      "source": [
        "# 查看多个ZIP压缩文件里面的目录树"
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "_us5GDbwj6Zy",
        "colab_type": "code",
        "cellView": "form",
        "colab": {}
      },
      "source": [
        "#@markdown 点击左侧按钮，查看整个目录下ZIP压缩包的目录结构\n",
        "\n",
        "#@markdown <font size=\"4\" color=red><b>destination</b></font>  查看的文件夹的路径（不带.zip后缀）\n",
        "\n",
        "destination =  \"\" #@param {type:\"string\"}\n",
        "\n",
        "!unzip -l \"$destination/*.zip\""
      ],
      "execution_count": null,
      "outputs": []
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "7nyY-DELpKqH",
        "colab_type": "text"
      },
      "source": [
        "### 解压单个ZIP压缩包 ****支持分压卷****"
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "zp0_u_kLo41y",
        "colab_type": "code",
        "cellView": "form",
        "colab": {}
      },
      "source": [
        "#@markdown 点击左侧按钮，解压单个ZIP压缩包\n",
        "\n",
        "#@markdown <font size=\"4\" color=red><b>destination</b></font>  解压的文件的路径（带.zip后缀）\n",
        "\n",
        "destination =  \"\" #@param {type:\"string\"}\n",
        "\n",
        "#@markdown <font size=\"4\" color=red><b>files</b></font>  解压文件的目的地(目录)\n",
        "\n",
        "files = \"\" #@param {type:\"string\"}\n",
        "\n",
        "#@markdown <font size=\"4\" color=red><b>password</b></font>  解压密码（有就填写没有就不填）\n",
        "\n",
        "password = \"\" #@param {type:\"string\"}\n",
        "\n",
        "print(\"若没有设置密码则直接回车即可\")\n",
        "\n",
        "!7z x -aoa \"$destination\" -P\"$password\" -o\"$files\" \n"
      ],
      "execution_count": null,
      "outputs": []
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "YKVdsgGTo7xp",
        "colab_type": "text"
      },
      "source": [
        "## 批量解压ZIP"
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "dDmSDx7ApHTP",
        "colab_type": "code",
        "cellView": "form",
        "colab": {}
      },
      "source": [
        "#@markdown 点击左侧按钮，解压整个目录下多个ZIP压缩包\n",
        "\n",
        "#@markdown <font size=\"4\" color=red><b>destination</b></font>  填入要解压的文件的路径（不带.zip后缀）\n",
        "\n",
        "destination =  \"\" #@param {type:\"string\"}\n",
        "\n",
        "#@markdown <font size=\"4\" color=red><b>files</b></font>  解压文件的目的地(目录)\n",
        "\n",
        "files = \"\" #@param {type:\"string\"}\n",
        "\n",
        "#@markdown <font size=\"4\" color=red><b>password</b></font>  解压密码（有就填写没有就不填，因为是批量！所以必须密码是统一的，否则必定报错！！！）\n",
        "\n",
        "password = \"\" #@param {type:\"string\"}\n",
        "\n",
        "print(\"若没有设置密码则直接回车即可\")\n",
        "\n",
        "!7z x -aoa \"$destination/*.zip\" -P\"$password\" -o\"$files\" "
      ],
      "execution_count": null,
      "outputs": []
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "aXy3kBftk3LJ",
        "colab_type": "text"
      },
      "source": [
        "# **7Z**\n"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "4dsc5GMffmWp",
        "colab_type": "text"
      },
      "source": [
        "# 查看单个7Z压缩文件的目录树"
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "UBgJ1_ghhBJ0",
        "colab_type": "code",
        "cellView": "form",
        "colab": {}
      },
      "source": [
        "#@markdown 点击左侧按钮，查看单个7Z压缩包的目录结构\n",
        "\n",
        "#@markdown <font size=\"4\" color=red><b>destination</b></font> 查看压缩包的路径（带.7z后缀）\n",
        "\n",
        "destination =  \"\" #@param {type:\"string\"}\n",
        "\n",
        "!7z l \"$destination\""
      ],
      "execution_count": null,
      "outputs": []
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "nkIHIWOghOQ-",
        "colab_type": "text"
      },
      "source": [
        "# 查看多个7Z压缩文件的目录树"
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "mRx5iAMhhU56",
        "colab_type": "code",
        "cellView": "form",
        "colab": {}
      },
      "source": [
        "#@markdown 点击左侧按钮，查看整个目录下7Z压缩包的目录结构\n",
        "\n",
        "#@markdown <font size=\"4\" color=red><b>destination</b></font>  查看目录的路径（不带.7z后缀）\n",
        "\n",
        "destination =  \"\" #@param {type:\"string\"}\n",
        "\n",
        "!7z l \"$destination/*.7z.*\""
      ],
      "execution_count": null,
      "outputs": []
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "UtoOOtNwlVqs",
        "colab_type": "text"
      },
      "source": [
        "## 解压单个7Z压缩包 ****支持分压卷****"
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "l42Pdhjjk7On",
        "colab_type": "code",
        "cellView": "form",
        "colab": {}
      },
      "source": [
        "#@markdown 点击左侧按钮，解压单个7Z压缩包\n",
        "\n",
        "#@markdown <font size=\"4\" color=red><b>destination</b></font>  解压的7Z压缩包的路径（带.7z后缀）\n",
        "\n",
        "destination =  \"\" #@param {type:\"string\"}\n",
        "\n",
        "#@markdown <font size=\"4\" color=red><b>files</b></font>  解压压缩文件到文件夹目录(目的地)\n",
        "\n",
        "files = \"\" #@param {type:\"string\"}\n",
        "\n",
        "#@markdown <font size=\"4\" color=red><b>password</b></font>  压缩密码（有就填写没有就不填）\n",
        "\n",
        "password = \"\" #@param {type:\"string\"}\n",
        "\n",
        "print(\"若没有设置密码则直接回车即可\")\n",
        "\n",
        "!7z x -aoa \"$destination\" -P\"$password\" -r -o\"$files\""
      ],
      "execution_count": null,
      "outputs": []
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "PdLQstMLnESX",
        "colab_type": "text"
      },
      "source": [
        "## 批量解压7z\n"
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "1vODPmEqnKCy",
        "colab_type": "code",
        "cellView": "form",
        "colab": {}
      },
      "source": [
        "#@markdown 点击左侧按钮，解压整个目录下多个7Z压缩包\n",
        "\n",
        "#@markdown <font size=\"4\" color=red><b>destination</b></font>  解压的文件目录的路径（不带.7z后缀）\n",
        "\n",
        "destination =  \"\" #@param {type:\"string\"}\n",
        "\n",
        "#@markdown <font size=\"4\" color=red><b>files</b></font>  解压压缩文件到文件夹目录(目的地)\n",
        "\n",
        "files = \"\" #@param {type:\"string\"}\n",
        "\n",
        "#@markdown <font size=\"4\" color=red><b>password</b></font>  压缩密码（有就填写没有就不填，因为是批量！所以必须密码是统一的，否则必定报错！！！）\n",
        "\n",
        "password = \"\" #@param {type:\"string\"}\n",
        "\n",
        "print(\"若没有设置密码则直接回车即可\")\n",
        "\n",
        "!7z x -aoa \"$destination/*.7z\" -P\"$password\" -o\"$files\" "
      ],
      "execution_count": null,
      "outputs": []
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "Gox7M85YoQq9",
        "colab_type": "text"
      },
      "source": [
        "#  <font color=red><b>**通用格式**</b></font>\n",
        "\n"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "RX194Z_7ovDC",
        "colab_type": "text"
      },
      "source": [
        "# 查看单个压缩文件的目录树"
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "Ft1TyA3uo1VM",
        "colab_type": "code",
        "cellView": "form",
        "colab": {}
      },
      "source": [
        "#@markdown 点击左侧按钮，查看单个压缩包的目录结构\n",
        "\n",
        "#@markdown <font size=\"4\" color=red><b>destination</b></font> 查看压缩包的路径（带.xxx后缀）\n",
        "\n",
        "destination =  \"\" #@param {type:\"string\"}\n",
        "\n",
        "!7z l \"$destination\""
      ],
      "execution_count": null,
      "outputs": []
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "sMevjvHeo8xR",
        "colab_type": "text"
      },
      "source": [
        "# 查看多个压缩文件的目录树"
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "QzIn1qjKo-QN",
        "colab_type": "code",
        "cellView": "form",
        "colab": {}
      },
      "source": [
        "#@markdown 点击左侧按钮，查看整个目录下压缩包的目录结构\n",
        "\n",
        "#@markdown <font size=\"4\" color=red><b>destination</b></font>  查看目录的路径（不带.xxx后缀）\n",
        "\n",
        "destination =  \"\" #@param {type:\"string\"}\n",
        "\n",
        "!7z l \"$destination/*.*\""
      ],
      "execution_count": null,
      "outputs": []
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "PU18MJOOpLkc",
        "colab_type": "text"
      },
      "source": [
        "## 解压单个压缩包 ****支持分压卷****"
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "g8EysIejpMDx",
        "colab_type": "code",
        "cellView": "form",
        "colab": {}
      },
      "source": [
        "#@markdown 点击左侧按钮，解压单个压缩包\n",
        "\n",
        "\n",
        "#@markdown <font size=\"4\" color=red><b>destination</b></font>  解压的7Z压缩包的路径（带.xxx后缀）\n",
        "\n",
        "destination =  \"\" #@param {type:\"string\"}\n",
        "\n",
        "#@markdown <font size=\"4\" color=red><b>files</b></font>  解压压缩文件到文件夹目录(目的地)\n",
        "\n",
        "files = \"\" #@param {type:\"string\"}\n",
        "\n",
        "#@markdown <font size=\"4\" color=red><b>password</b></font>  压缩密码（有就填写没有就不填）\n",
        "\n",
        "password = \"\" #@param {type:\"string\"}\n",
        "\n",
        "!7z x -aoa \"$destination\" -P\"$password\" -r -o\"$files\""
      ],
      "execution_count": null,
      "outputs": []
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "Og2T06y5pVVR",
        "colab_type": "text"
      },
      "source": [
        "## 批量解压\n"
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "_-t-Jb3KpYiT",
        "colab_type": "code",
        "cellView": "form",
        "colab": {}
      },
      "source": [
        "#@markdown 点击左侧按钮，解压整个目录下多个压缩包\n",
        "\n",
        "#@markdown <font size=\"4\" color=red><b>destination</b></font>  解压的文件目录的路径（不带.xxx后缀）\n",
        "\n",
        "destination =  \"\" #@param {type:\"string\"}\n",
        "\n",
        "#@markdown <font size=\"4\" color=red><b>files</b></font>  解压压缩文件到文件夹目录(目的地)\n",
        "\n",
        "files = \"\" #@param {type:\"string\"}\n",
        "\n",
        "#@markdown <font size=\"4\" color=red><b>password</b></font>  压缩密码（有就填写没有就不填，因为是批量！所以必须密码是统一的，否则必定报错！！！）\n",
        "\n",
        "password = \"\" #@param {type:\"string\"}\n",
        "\n",
        "!7z x -aoa \"$destination/*.*\" -P\"$password\" -o\"$files\" "
      ],
      "execution_count": null,
      "outputs": []
    }
  ]
}